package managers;
import entities.*;
import dataProviders.*;
import java.util.Arrays;
public class LoginManager 
{
	LoginManager(String l, String h)
	{
		
	}
	public static Pracownik dokonajAutoryzacji(String login, char[] haslo)
	{		
		String tmpHaslo = UsersDataProvider.getHaslo(login);	
		if(tmpHaslo!=null && Arrays.equals(haslo,tmpHaslo.toCharArray()))
		{
			Pracownik tmpPrac = UsersDataProvider.getUser(login);
			UsersDataProvider.setLoggedUser(tmpPrac);
			return tmpPrac;
		}
		else 			
			return null;
		
	}
}
